package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.picture;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.picture.PictureService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

@Action
@RequestMapping(value="business/picture")
public class PictureController {
    @Resource
    private PictureService pictureService;

    @At(value = "delete", method = RequestMethod.POST)
    public RespEntity delete(@RequestBody(required = false) JSONObject jsonParam) {
        return pictureService.delete(jsonParam);
    }

//    @At(value = "pictureList", method = RequestMethod.GET, param = { "businessId"})
//    public RespEntity pictureList(@RequestBody(required = false) JSONObject jsonParam) {
//        return pictureService.pictureList(jsonParam);
//    }

    @At(value = "pictureList", method = RequestMethod.GET, param = { "businessId"})
    public RespEntity pictureList(@RequestBody(required = false) JSONObject jsonParam) {
        return pictureService.pictureList(jsonParam);
    }
}
